﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo03
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = {9,3,6,1,5};
            for (int i = 0; i < a.Length; i++)
            {
                for (int j = 0; j < a.Length-i-1; j++)
                {
                    if (a[j] < a[j+1])
                    {
                        int temp = a[j];
                        a[j] = a[j+1];
                        a[j + 1] = temp;
                    }
                }
            }
            Console.WriteLine("从大到小的排序为：");
            foreach (var item in a)
            {
                Console.Write(item + ",");
            }
            Console.WriteLine();
        }
    }
}
